class Solution:
    def removeDuplicates(self, nums) -> int:
        mid_nums = list(set(nums))
        while len(nums) != 0:
            nums.pop(-1)
        nums.extend(mid_nums)
        nums.sort()
        return len(nums)


a = Solution()
nums = [1, 1, 2]
print(a.removeDuplicates(nums))
print(nums)